package com.rybbaby.tss.front.tssPaymentHistory.service.imp;

import com.rybbaby.tss.core.web.service.imp.BaseServiceImp;
import com.rybbaby.tss.front.tssPayment.entity.TssPayment;
import com.rybbaby.tss.front.tssPaymentHistory.dao.ITssPaymentHistoryDao;
import com.rybbaby.tss.front.tssPaymentHistory.entity.TssPaymentHistory;
import com.rybbaby.tss.front.tssPaymentHistory.service.ITssPaymentHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * @description 缴费表数据库操作服务实现
 * 
 * @author 雷春琼
 * 
 * @createDate 2017-08-10 上午12:22:55
 */
@Service
@Transactional
public class TssPaymentHistoryServiceImp extends BaseServiceImp<TssPaymentHistory> implements ITssPaymentHistoryService {
    @Autowired
    private  ITssPaymentHistoryDao tssPaymentHistoryDao;
    @Override
    public Serializable saveHistory(TssPayment entity) {
        TssPaymentHistory tssPaymentHistory = new TssPaymentHistory();

        tssPaymentHistory.setPaymentId(entity.getId());
        tssPaymentHistory.setStuId(entity.getStuId());
        tssPaymentHistory.setAdminUserId(entity.getAdminUserId());
        tssPaymentHistory.setPackageId(entity.getPackageId());
        tssPaymentHistory.setApplyStatus(entity.getApplyStatus());
        tssPaymentHistory.setAmount(entity.getAmount());
        tssPaymentHistory.setPaymentCode(entity.getPaymentCode());
        tssPaymentHistory.setPaymentType(entity.getPaymentType());
        tssPaymentHistory.setDepositStatus(entity.getDepositStatus());
        tssPaymentHistory.setRemark(entity.getRemark());
        tssPaymentHistory.setEmpAdminUserId(entity.getEmpAdminUserId());
        tssPaymentHistory.setCreateTime(entity.getCreateTime());
        tssPaymentHistory.setUpdateTime(entity.getUpdateTime());
        tssPaymentHistory.setVersion(entity.getVersion());
        /*tssPaymentHistory.setPaymemtStatus(entity.getPaymemtStatus());*/

        return tssPaymentHistoryDao.save(tssPaymentHistory);
    }
}


